<?php 
$this->Paginator->options(array(
    'update' => '#content',
    'evalScripts' => true,
    'before' => $this->Js->get('#ajax-indicator')->effect('fadeIn', array('buffer' => false)),
    'complete' => $this->Js->get('#ajax-indicator')->effect('fadeOut', array('buffer' => false)),
));
?>
<div class="page">
	<div class="page-header">
		<h2><small><?php echo __('Gerenciar Imagens');?></small></h2>
	</div>
	<div class="page-content">
	<?php if(empty($images)):?>
		<p>Nenhuma imagem encontrada.</p>
	<?php else:?>
		<table class="table table-bordered table-striped">
		<thead>
		<tr>
			<th><?php echo $this->Paginator->sort('Nome', 'name');?></th>
			<th><?php echo 'Imagem';?></th>
			<th class="actions"><?php echo __('Ações');?></th>
		</tr>
		</thead>
		<tbody>
<?php
		foreach ($images as $image): ?>
		<tr>
			<td><?php echo h($image['Image']['name']); ?>&nbsp;</td>
			<td><?php echo $this->Html->image($image['Image']['file'], array('width' => '100px')); ?>&nbsp;</td>
			<td class="actions">
			<?php 
				echo $this->Js->link( '<i class="icon-trash icon-white"></i>',
					array('controller' => 'images','action' => 'delete', $image['Image']['id']),
					array(
						'id'=>'bt_del_solict'.$image['Image']['id'],
						'escape' => false,
						'confirm' => 'Deseja excluir registro?',
					    'before' => $this->Js->get('#ajax-indicator')->effect('fadeIn', array('buffer' => false)),
					    'complete' => $this->Js->get('#ajax-indicator')->effect('fadeOut', array('buffer' => false))
						. ' listarAnexos();',
						'class' => 'btn btn-danger btn-mini',
						'buffer' => false
					));
				?>
			</td>
		</tr>
<?php endforeach; ?>
		</tbody>
		</table>
		<p>
<?php
		echo $this->Paginator->counter(array(
		'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
		));
		?>		</p>
	
		<div class="paging">
<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
		</div>
		<?php endif;?>
	</div>
	<div class="page-footer"></div>
</div>

